\(\int \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx\) [291]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 26, antiderivative size = 154 \[ \int \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {5 i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a} \sec (c+d x)}{\sqrt {2} \sqrt {a+i a \tan (c+d x)}}\right )}{8 \sqrt {2} d}+\frac {5 i a \cos (c+d x)}{12 d \sqrt {a+i a \tan (c+d x)}}-\frac {5 i \cos (c+d x) \sqrt {a+i a \tan (c+d x)}}{8 d}-\frac {i \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)}}{3 d} \]

[Out]

5/16*I*arctanh(1/2*sec(d*x+c)*a^(1/2)*2^(1/2)/(a+I*a*tan(d*x+c))^(1/2))*a^(1/2)/d*2^(1/2)+5/12*I*a*cos(d*x+c)/
d/(a+I*a*tan(d*x+c))^(1/2)-5/8*I*cos(d*x+c)*(a+I*a*tan(d*x+c))^(1/2)/d-1/3*I*cos(d*x+c)^3*(a+I*a*tan(d*x+c))^(
1/2)/d

Rubi [A] (verified)

Time = 0.26 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3578, 3583, 3571, 3570, 212} \[ \int \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {5 i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a} \sec (c+d x)}{\sqrt {2} \sqrt {a+i a \tan (c+d x)}}\right )}{8 \sqrt {2} d}-\frac {i \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)}}{3 d}-\frac {5 i \cos (c+d x) \sqrt {a+i a \tan (c+d x)}}{8 d}+\frac {5 i a \cos (c+d x)}{12 d \sqrt {a+i a \tan (c+d x)}} \]

[In]

Int[Cos[c + d*x]^3*Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

(((5*I)/8)*Sqrt[a]*ArcTanh[(Sqrt[a]*Sec[c + d*x])/(Sqrt[2]*Sqrt[a + I*a*Tan[c + d*x]])])/(Sqrt[2]*d) + (((5*I)
/12)*a*Cos[c + d*x])/(d*Sqrt[a + I*a*Tan[c + d*x]]) - (((5*I)/8)*Cos[c + d*x]*Sqrt[a + I*a*Tan[c + d*x]])/d -
((I/3)*Cos[c + d*x]^3*Sqrt[a + I*a*Tan[c + d*x]])/d

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3570

Int[sec[(e_.) + (f_.)*(x_)]/Sqrt[(a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]], x_Symbol] :> Dist[-2*(a/(b*f)), Subst[
Int[1/(2 - a*x^2), x], x, Sec[e + f*x]/Sqrt[a + b*Tan[e + f*x]]], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 + b^
2, 0]

Rule 3571

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(d*
Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/(a*f*m)), x] + Dist[a/(2*d^2), Int[(d*Sec[e + f*x])^(m + 2)*(a + b*Tan
[e + f*x])^(n - 1), x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2 + b^2, 0] && EqQ[m/2 + n, 0] && GtQ[n, 0]

Rule 3578

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(d*S
ec[e + f*x])^m*((a + b*Tan[e + f*x])^n/(a*f*m)), x] + Dist[a*((m + n)/(m*d^2)), Int[(d*Sec[e + f*x])^(m + 2)*(
a + b*Tan[e + f*x])^(n - 1), x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2 + b^2, 0] && GtQ[n, 0] && LtQ[m, -
1] && IntegersQ[2*m, 2*n]

Rule 3583

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[a*(d*
Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/(b*f*(m + 2*n))), x] + Dist[Simplify[m + n]/(a*(m + 2*n)), Int[(d*Sec[
e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0] && NeQ[m + 2*n, 0] && IntegersQ[2*m, 2*n]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)}}{3 d}+\frac {1}{6} (5 a) \int \frac {\cos (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx \\ & = \frac {5 i a \cos (c+d x)}{12 d \sqrt {a+i a \tan (c+d x)}}-\frac {i \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)}}{3 d}+\frac {5}{8} \int \cos (c+d x) \sqrt {a+i a \tan (c+d x)} \, dx \\ & = \frac {5 i a \cos (c+d x)}{12 d \sqrt {a+i a \tan (c+d x)}}-\frac {5 i \cos (c+d x) \sqrt {a+i a \tan (c+d x)}}{8 d}-\frac {i \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)}}{3 d}+\frac {1}{16} (5 a) \int \frac {\sec (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx \\ & = \frac {5 i a \cos (c+d x)}{12 d \sqrt {a+i a \tan (c+d x)}}-\frac {5 i \cos (c+d x) \sqrt {a+i a \tan (c+d x)}}{8 d}-\frac {i \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)}}{3 d}+\frac {(5 i a) \text {Subst}\left (\int \frac {1}{2-a x^2} \, dx,x,\frac {\sec (c+d x)}{\sqrt {a+i a \tan (c+d x)}}\right )}{8 d} \\ & = \frac {5 i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a} \sec (c+d x)}{\sqrt {2} \sqrt {a+i a \tan (c+d x)}}\right )}{8 \sqrt {2} d}+\frac {5 i a \cos (c+d x)}{12 d \sqrt {a+i a \tan (c+d x)}}-\frac {5 i \cos (c+d x) \sqrt {a+i a \tan (c+d x)}}{8 d}-\frac {i \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)}}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.72 (sec) , antiderivative size = 126, normalized size of antiderivative = 0.82 \[ \int \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {i e^{-3 i (c+d x)} \left (-3+11 e^{2 i (c+d x)}+16 e^{4 i (c+d x)}+2 e^{6 i (c+d x)}-15 e^{2 i (c+d x)} \sqrt {1+e^{2 i (c+d x)}} \text {arctanh}\left (\sqrt {1+e^{2 i (c+d x)}}\right )\right ) \sqrt {a+i a \tan (c+d x)}}{48 d} \]

[In]

Integrate[Cos[c + d*x]^3*Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

((-1/48*I)*(-3 + 11*E^((2*I)*(c + d*x)) + 16*E^((4*I)*(c + d*x)) + 2*E^((6*I)*(c + d*x)) - 15*E^((2*I)*(c + d*
x))*Sqrt[1 + E^((2*I)*(c + d*x))]*ArcTanh[Sqrt[1 + E^((2*I)*(c + d*x))]])*Sqrt[a + I*a*Tan[c + d*x]])/(d*E^((3
*I)*(c + d*x)))

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 393 vs. \(2 (123 ) = 246\).

Time = 23.32 (sec) , antiderivative size = 394, normalized size of antiderivative = 2.56

method result size
default \(-\frac {i \sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, \left (15 i \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right ) \cos \left (d x +c \right )-15 i \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \arctan \left (\sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\right ) \sin \left (d x +c \right )+20 i \left (\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+15 i \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right )+15 \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right ) \sin \left (d x +c \right )+15 \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \arctan \left (\sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\right ) \cos \left (d x +c \right )-4 \left (\cos ^{3}\left (d x +c \right )\right )+15 \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \arctan \left (\sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\right )+30 \cos \left (d x +c \right )\right )}{48 d}\) \(394\)

[In]

int(cos(d*x+c)^3*(a+I*a*tan(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/48*I/d*(a*(1+I*tan(d*x+c)))^(1/2)*(15*I*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*arctanh(sin(d*x+c)/(cos(d*x+c)+1
)/(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2))*cos(d*x+c)-15*I*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*arctan((-cos(d*x+c)/(
cos(d*x+c)+1))^(1/2))*sin(d*x+c)+20*I*cos(d*x+c)^2*sin(d*x+c)+15*I*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*arctanh(
sin(d*x+c)/(cos(d*x+c)+1)/(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2))+15*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*arctanh(si
n(d*x+c)/(cos(d*x+c)+1)/(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2))*sin(d*x+c)+15*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*a
rctan((-cos(d*x+c)/(cos(d*x+c)+1))^(1/2))*cos(d*x+c)-4*cos(d*x+c)^3+15*(-cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*arct
an((-cos(d*x+c)/(cos(d*x+c)+1))^(1/2))+30*cos(d*x+c))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 245 vs. \(2 (115) = 230\).

Time = 0.28 (sec) , antiderivative size = 245, normalized size of antiderivative = 1.59 \[ \int \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {{\left (15 \, \sqrt {\frac {1}{2}} d \sqrt {-\frac {a}{d^{2}}} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (\frac {5 \, {\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} + i \, a\right )} e^{\left (-i \, d x - i \, c\right )}}{4 \, d}\right ) - 15 \, \sqrt {\frac {1}{2}} d \sqrt {-\frac {a}{d^{2}}} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (-\frac {5 \, {\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} - i \, a\right )} e^{\left (-i \, d x - i \, c\right )}}{4 \, d}\right ) + \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (-2 i \, e^{\left (6 i \, d x + 6 i \, c\right )} - 16 i \, e^{\left (4 i \, d x + 4 i \, c\right )} - 11 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 3 i\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{48 \, d} \]

[In]

integrate(cos(d*x+c)^3*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

1/48*(15*sqrt(1/2)*d*sqrt(-a/d^2)*e^(2*I*d*x + 2*I*c)*log(5/4*(sqrt(2)*sqrt(1/2)*(d*e^(2*I*d*x + 2*I*c) + d)*s
qrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(-a/d^2) + I*a)*e^(-I*d*x - I*c)/d) - 15*sqrt(1/2)*d*sqrt(-a/d^2)*e^(2*I*
d*x + 2*I*c)*log(-5/4*(sqrt(2)*sqrt(1/2)*(d*e^(2*I*d*x + 2*I*c) + d)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(-a
/d^2) - I*a)*e^(-I*d*x - I*c)/d) + sqrt(2)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*(-2*I*e^(6*I*d*x + 6*I*c) - 16*I*
e^(4*I*d*x + 4*I*c) - 11*I*e^(2*I*d*x + 2*I*c) + 3*I))*e^(-2*I*d*x - 2*I*c)/d

Sympy [F(-1)]

Timed out. \[ \int \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**3*(a+I*a*tan(d*x+c))**(1/2),x)

[Out]

Timed out

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 935 vs. \(2 (115) = 230\).

Time = 0.48 (sec) , antiderivative size = 935, normalized size of antiderivative = 6.07 \[ \int \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\text {Too large to display} \]

[In]

integrate(cos(d*x+c)^3*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

-1/192*(8*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(3/4)*(I*sqrt(2)*cos(3/2*arctan2(
sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) - sqrt(2)*sin(3/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))*s
qrt(a) + 12*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*((-I*sqrt(2)*cos(2*d*x +
2*c) - sqrt(2)*sin(2*d*x + 2*c) + 4*I*sqrt(2))*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + (sqr
t(2)*cos(2*d*x + 2*c) - I*sqrt(2)*sin(2*d*x + 2*c) - 4*sqrt(2))*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x +
2*c) + 1)))*sqrt(a) + 15*(2*sqrt(2)*arctan2((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)
^(1/4)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*
cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + 1) - 2*sqrt(2)*arctan2(
(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos
(2*d*x + 2*c) + 1)), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(
sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) - 1) - I*sqrt(2)*log(sqrt(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2
*cos(2*d*x + 2*c) + 1)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))^2 + sqrt(cos(2*d*x + 2*c)^2 +
sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))^2 + 2*(c
os(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2
*d*x + 2*c) + 1)) + 1) + I*sqrt(2)*log(sqrt(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)*
cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))^2 + sqrt(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*
cos(2*d*x + 2*c) + 1)*sin(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1))^2 - 2*(cos(2*d*x + 2*c)^2 + sin
(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + 1))
*sqrt(a))/d

Giac [F]

\[ \int \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\int { \sqrt {i \, a \tan \left (d x + c\right ) + a} \cos \left (d x + c\right )^{3} \,d x } \]

[In]

integrate(cos(d*x+c)^3*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(I*a*tan(d*x + c) + a)*cos(d*x + c)^3, x)

Mupad [F(-1)]

Timed out. \[ \int \cos ^3(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\int {\cos \left (c+d\,x\right )}^3\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}} \,d x \]

[In]

int(cos(c + d*x)^3*(a + a*tan(c + d*x)*1i)^(1/2),x)

[Out]

int(cos(c + d*x)^3*(a + a*tan(c + d*x)*1i)^(1/2), x)